
<!DOCTYPE html>
<html lang="zh">
<head>
<title>账户资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<meta http-equiv="Cache-Control" content="no-transform" /> 
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="applicable-device" content="pc,mobile">
<link href="__PUBLIC__/css/style_wap.css" rel="stylesheet">
<link href="__PUBLIC__/ext/fontawesome463/css/font-awesome.min.css" rel="stylesheet">
</head>
<body id="ucenterpage">
	<include file="Public/header"/>
	<div class="block">
		<include file="Public/ucmenu"/>
		
		<div id="uc_right">
			<h3 class="title">账户资料修改</h3>
			
			<div id="ucinfo">
				<table class="table2 aorange">
					<tr>
						<td width="100" align="center">邮箱</td>
						<td><div class="tel"><input type="text" id="email" value="{$data['email']}"/></div></td>
					</tr>
					<tr>
						<td width="100" align="center">联系电话</td>
						<td><div class="tel"><input type="text" id="phone" value="{$data['phone']}"/></div></td>
					</tr>
				</table>
				<a href="javascript:void(0);" class="ucbtn" id="setinfo" >修改</a>
			</div>
			<br ><br ><br >
			<h3 class="title">密码修改</h3>
			<div id="ucinfo">
				<table class="table2 aorange">
					<tr>
						<td width="100" align="center">旧密码</td>
						<td><div class="tel"><input type="password" id="oldpwd" value=""/></div></td>
					</tr>
					<tr>
						<td width="100" align="center">新密码</td>
						<td><div class="tel"><input type="password" id="newpwd" value=""/></div></td>
					</tr>
					<tr>
						<td width="100" align="center">新密码确认</td>
						<td><div class="tel"><input type="password" id="pwd" value=""/></div></td>
					</tr>
					
				</table>
				<a href="javascript:void(0);" class="ucbtn" id="setpwd">修改</a>
			</div>
			
		</div>
	
	</div>
	<script src="__PUBLIC__/js/jquery-2.1.4.min.js"></script>
	<script src="__PUBLIC__/js/jquery.cookie.js"></script>
	<include file="Public/footer"/>
	<script src="__PUBLIC__/js/ext/jquery.ajaxcall.js"></script>
	<script>
		$(function(){
			$('#setinfo').click(function(){
				var email = $('#email').val();
				var phone = $('#phone').val();
				if(!email || !phone){
					alert('请把信息补充完整');
					return false;
				}
				$.ajaxcall('{:U("/user/index/setinfo")}','phone='+phone+'&email='+email,function(data){
					alert('修改成功');
				});
			});
			
			$('#setpwd').click(function(){
				var oldpwd = $('#oldpwd').val();
				var newpwd = $('#newpwd').val();
				var pwd = $('#pwd').val();
				if(!oldpwd || !newpwd || !pwd){
					alert('请把密码完善');
					return false;
				}
				if(newpwd!=pwd){
					alert('两次输入的密码不一致');
					return false;
				}
				$.ajaxcall('{:U("/user/index/setpwd")}','oldpwd='+oldpwd+'&pwd='+pwd,function(data){
					alert(data);
				});
				
			});
			
		})
	</script>
</body>
</html>